package xlimit

import "errors"

var ErrRateLimiterNotFound = errors.New("rate limiter not found")
var ErrRateLimiterRegistryNotInited = errors.New("rate limit registry not inited! Call `Init()` first!")

// abstraction of rate limiter, implemented by both `LeakyBucketRateLimiter` and `SlidingWindowRateLimiter`
type RateLimiter interface {
	Limit(metric string) error
	ChangeQpsThreshold(newQpsThreshold int64)
}

// just make sure
var _ RateLimiter = (*LeakyBucketRateLimiter)(nil)
var _ RateLimiter = (*SlidingWindowRateLimiter)(nil)
